//
// Created by yuping.li on 10/14/24.
//

#include "cpp_adapter.h"
#include "single_thread_scheduler.hpp"
#include "incubator/ds18b20_get_temperature_task.hpp"
#include "incubator/pwm_duty_adjust_task.hpp"
#include "misc/delay_init_task.hpp"
#include "misc/led_indicator.hpp"
#include "incubator/display_task.hpp"
#include "incubator/user_input_task.hpp"
#include "fish_feeder/fish_feeder.hpp"
#include "tim/iwdg_task.hpp"

void cpp_startup() {
  Time::instance().init(&hrtc);
  auto scheduler = std::make_unique<SingleThreadScheduler>();
  scheduler->add_task(std::make_unique<DelayInitTask>());
  scheduler->add_task(std::make_unique<UserInputTask>());
  scheduler->add_task(std::make_unique<Ds18b20GetTemperatureTask>());
  scheduler->add_task(std::make_unique<PwmDutyAdjustTask>());
  scheduler->add_task(std::make_unique<DisplayTask>());
  scheduler->add_task(std::make_unique<FishFeeder>());
  scheduler->add_task(std::make_unique<IWDGTask>());
  scheduler->scheduler();
}